package online.cmagic.createType.singleton;

/**
 * 枚举单例
 *
 * @author wangsc
 * @date: 2020年04月12日 12:23
 * @since JDK 1.8
 */
public enum EnumSingleton {

    ALIPAY("1") {
        @Override
        public void method() {
            System.out.println("ALIPAY method");
        }
    },
    WECHAT("2"){
        @Override
        public void method() {
            System.out.println("wechat method");
        }
    };


    private String code;

    EnumSingleton(String code) {
        this.code = code;
    }

    public void method() {
        System.out.println("EnumSingleton instance method invoke");
    }

    public String getCode(){
        return this.code;
    }
}



